package com.alibaba.csp.sentinel.dashboard.rule.nacos;

import com.alibaba.nacos.api.config.ConfigFactory;
import com.alibaba.nacos.api.config.ConfigService;
import com.alibaba.nacos.api.exception.NacosException;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author zhangziyao
 * @date 2021/5/17
 */
@Configuration
public class NacosConfig {


    @Value("${sentinel.nacos.config.serverAddr}")
    private String serverAddr = "49.232.166.207:8848";

    @Bean
    public ConfigService configService() throws NacosException {
        return ConfigFactory.createConfigService(serverAddr);
    }
}
